import request from '@/utils/request'

import type { responseDataType, BaiDuData, TouTiaoData } from './model'
const githubRequest = request.init(import.meta.env.VITE_APP_GITHUB_API)
const oiowebRequest = request.init(import.meta.env.VITE_APP_OIOWEB_API)

// 百度热点
export function getHotSearch(type: string) {
  return oiowebRequest.get<any, responseDataType<BaiDuData>>('/common/fetchHotSearchBoard', { params: { type } })
}

// 头条热点
export function getTouTiao() {
  return githubRequest.get<any, TouTiaoData[]>('repos/octocat/Spoon-Knife/issues')
}
